package cn.seqdata.jpa.lookup;

import java.util.Objects;

import cn.seqdata.jpa.JpaString;

public class LookupJpaString extends LookupKeyval<String> {

	public LookupJpaString() {
	}

	public LookupJpaString(String id, String name) {
		super(id, name);
	}

	public LookupJpaString(JpaString entity) {
		this(entity.getId(), entity.getName());
	}

	@Override
	public String getId() {
		return id;
	}

	@Override
	public int hashCode() {
		return Objects.hashCode(id);
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		LookupJpaString other = (LookupJpaString) obj;
		return Objects.equals(id, other.id);
	}
}
